package cn.coastalinfo.project.drools.domain.bo;

import cn.coastalinfo.common.core.validate.AddGroup;
import cn.coastalinfo.common.core.validate.EditGroup;
import cn.coastalinfo.framework.web.domain.TreeEntity;
import cn.coastalinfo.project.drools.enums.ConditionType;
import cn.coastalinfo.project.drools.enums.OPeratorType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.*;


/**
 * 规则条件业务对象
 *
 * @author hadge
 * @date 2024-06-08
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class RuleConditionBo extends TreeEntity<RuleConditionBo> {

    /**
     *
     */

    private Long id;

    /**
     * 规则id
     */

    @ApiModelProperty("规则id")
    @NotNull(message = "规则id不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long ruleId;

    /**
     * 类型，and,or,normal
     */

    @ApiModelProperty("类型，并且,或者,条件")
    @NotBlank(message = "类型，and,or,normal不能为空", groups = {AddGroup.class, EditGroup.class})
    private ConditionType type;

    /**
     * 表达式左值类型，variable,input
     */

    @ApiModelProperty("表达式左值类型，variable,input")
    private String leftType;

    @ApiModelProperty("表达式左值中文名")
    private String leftLabel;

    /**
     * 表达式左值id
     */

    @ApiModelProperty("表达式左值id")
    @NotNull(message = "表达式左值id不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long leftId;

    /**
     * 左值缓存名
     */

    @ApiModelProperty("左值缓存名")
    @NotBlank(message = "左值缓存名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String leftValue;

    /**
     * 操作符
     */

    @ApiModelProperty("操作符")
    private OPeratorType operator;

    /**
     * 表达式右值类型，variable,input
     */

    @ApiModelProperty("表达式右值类型，Variable,Input,默认")
    private String rightType;

    @ApiModelProperty("表达式右值中文名")
    private String rightLabel;

    /**
     * 表达式右值id
     */

    @ApiModelProperty("表达式右值id")
    @NotNull(message = "表达式右值id不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long rightId;

    /**
     * 右值缓存名
     */

    @ApiModelProperty("右值缓存名")
    @NotBlank(message = "右值缓存名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String rightValue;

    @ApiModelProperty("那么")
    private String thenSet;
}
